#include <stdio.h>

union test_un {
	char a;
	int b;
};

int main(void)
{
	union test_un t;
	t.b = 255;
	int num = 0x12345678;
	char *p = (char *)&num;

	printf("%#x\n", *p);

	printf("%ld\n", sizeof(t));
	printf("%p %p\n", &t.a, &t.b);
	printf("%d\n", t.a);

	// 0x78低字节 0x56 0x34 0x12高字节
	t.b = 0x12345678;

	printf("%#x\n", t.a);

	return 0;
}

